﻿using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TRACv2.Domain.DTO;
using Moq;
using TRACv2.Domain.Interfaces.IRepository;
using TRACv2.Domain.Services;

//Author: Morgan William Davis III
//Project: TRAC Ticket Manager v2
//Date: 21 Mar 2014

namespace TRACv2.Domain.Test
{
    [TestClass]
    [ExcludeFromCodeCoverage]
    public class TicketServiceTest
    {
        [TestMethod]
        public void Add_EmptyDTOArgument_MethodStillCallsRepository()
        {
            //Arange
            var ticketRepo = new Mock<ITicketRepository>();
            var service = new TicketService(ticketRepo.Object);
            var testTicket = new TicketDTO();

            //Act
            service.Add(testTicket);

            //Assert
            Assert.IsTrue(true);
        }

        [TestMethod]
        public void Update_EmptyDTOArgument_MethodStillCallsRepository()
        {
            //Arange
            var ticketRepo = new Mock<ITicketRepository>();
            var service = new TicketService(ticketRepo.Object);
            var testTicket = new TicketDTO();

            //Act
            service.Update(testTicket);

            //Assert
            Assert.IsTrue(true);
        }

        [TestMethod]
        public void Delete_EmptyDTOArgument_MethodStillCallsRepository()
        {
            //Arange
            var ticketRepo = new Mock<ITicketRepository>();
            var service = new TicketService(ticketRepo.Object);
            var testTicket = new TicketDTO();

            //Act
            service.Delete(testTicket);

            //Assert
            Assert.IsTrue(true);
        }

        [TestMethod]
        public void Archive_EmptyDTOArgument_MethodStillCallsRepository()
        {
            //Arange
            var ticketRepo = new Mock<ITicketRepository>();
            var service = new TicketService(ticketRepo.Object);
            var testTicket = new TicketDTO();

            //Act
            service.Archive(testTicket);

            //Assert
            Assert.IsTrue(true);
        }

        [TestMethod]
        public void GetByNumber_NullStringArgument_MethodStillCallsRepository()
        {
            //Arange
            var ticketRepo = new Mock<ITicketRepository>();
            var service = new TicketService(ticketRepo.Object);
            var testTicket = new TicketDTO(){Number = null};

            //Act
            service.GetByNumber(testTicket.Number);

            //Assert
            Assert.IsTrue(true);
        }

        [TestMethod]
        public void GetByNumber_EmptyStringArgument_MethodStillCallsRepository()
        {
            //Arange
            var ticketRepo = new Mock<ITicketRepository>();
            var service = new TicketService(ticketRepo.Object);
            var testTicket = new TicketDTO(){Number = ""};

            //Act
            service.GetByNumber(testTicket.Number);

            //Assert
            Assert.IsTrue(true);
        }
    }
}
